package com.stupidzhe.vbreview.bean;

import java.util.List;

/**
 * Created by Mr.W on 2017/7/4.
 * 分页bean
 */
public class PageBean<T> {

    /**
     * 总页数
     */
    private int pageCount;

    private int rowCount;

    /**
     * 当前页数
     */
    private int pageNum;

    /**
     * 内容
     */
    private List<T> content;

    private int start;

    private int last;

    /**
     * 一页显示内容数
     */
    private int size = 5;

    public PageBean() {
    }

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
        start = (pageNum - 1) * size;
    }

    public List<T> getContent() {
        return content;
    }

    public void setContent(List<T> content) {
        this.content = content;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public int getRowCount() {
        return rowCount;
    }

    public void setRowCount(int rowCount) {
        this.rowCount = rowCount;
        pageCount = rowCount / size + (0 < rowCount % size ? 1 : 0);
    }

    public int getLast() {
        return last;
    }

    public void setLast(int last) {
        this.last = last;
    }
}
